Python built-in functions (55) -- round, python built-in 55 round
English document:
round(
Number[,
Ndigits])
Return the floating point value
NumberRounded
NdigitsDigits after the decimal point. If
NdigitsIs omitted, it
MySQL Rounding function round (x)The ROUND (x) function returns the integer closest to parameter x, rounding the X value.Instance:The operand is rounded using the round (x) function. The SQL statements are as follows:Mysql>select ROUND ( -2.34),
[BestCoder Round #7] hdu 4985 Little Pony and Permutation (find loop section ),
Little Pony and Permutation
Problem Description
As a unicorn, the ability of using magic is the distinguishing feature among other kind of pony. being familiar with
English documents:
round
(number[, ndigits])
Return The floating point value
number rounded to
ndigits digits after the decimal point. If
ndigits is omitted, it returns the
This article is the official HTML5 training course for h5edu institutions, mainly introduces: JavaScript intensive tutorial--javascript Math (Arithmetic) object The function of the Math object is: Perform common arithmetic tasks. Round () How to use
In python, round (x, [n]) uses round (x, [n]) to rounding n to retain the number of fractional parts
1. when n is not entered, the default value is 0, that is, the fractional part is not retained.A. When the decimal part is only 0.5, if the integer
Round (X,[n]) rounding n reserved fractional number1, when n is not filled, the default is 0, that is, the decimal part is not retainedA, when the fractional part is only 0.5 when the integer part if it is an odd number in 1, if even the fractional
Round (X,[n]) rounding n reserved fractional number
1, when n is not filled, the default is 0, that is, the decimal part is not retainedA, when the fractional part is only 0.5 when the integer part if it is an odd number in 1, if even the
The round () method returns the decimal point of a numeric value rounded to n digits.
Grammar
The following is the syntax for the Round () method:
Round (x [, N])
Parameters
X-This is a numeric value that represents the value that needs to be
Math. Round (11.5) returns (long) 12, math. Round (-11.5) returns (long)-11;
The math. Round () method adds the parameter 0.5 first and then obtains its math. Floor () value,Math. Floor ()You can obtain the integer part of a number,Math.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.